//===================================
//File: Shelf.cpp
//Shelf functions
//Name: Smirnova O.P.
//Date: 28.06.12, v.1.0
//===================================
#include "Shelf.h"
using namespace std;

unsigned int Shelf::count=0;
unsigned int Shelf::count_all=0;
//---------------------------------------------------------------------------


Shelf::Shelf()
{
	count_all++;
    id=count_all;
	count++;
	tl = Point(0,0,1);
	w=0;
	h=0;
};

Shelf::Shelf(Point tl,int w,int h)
{
	count_all++;
    id=count_all;
	count++;
 //cout << "\nShelf():\n";
 this->tl = tl;
 this->w = w;
 this->h = h;
 //cout << "Shelf()\n";
};

Shelf::~Shelf()
{
	//cout << "\n~Shelf:\n";
	//cout << "~Shelf\n";
};

//Вывод на экран
void Shelf::write() {
    cout << "Self ID: "<<id<<endl;
	cout << "TopLeft point = " << tl << endl;
	cout << "Width =" << w << " Height =" << h << endl;
}

void Shelf::moveTo (Point p)
{
	tl.moveToPoint(p);

};

void Shelf::moveTodXdY (double x, double y)
	{

	tl.moveTodXdY(x,y);
};


//---------------------------------------------------------------------------
const unsigned int Shelf::getID()
{
  return id;
};
//---------------------------------------------------------------------------
unsigned int Shelf::countObject()
{
  return count; 
};

int Shelf::getWidth()
{
	return w;	
}
int Shelf::getHeight()
{
	return h;	
}
Point Shelf::getPoint()
{
	return tl;
}
